@extends('goods.base.index')


@section('content')
<!-- Content>
<!-- Messages Drawer -->
	 <div class="block-area" id="defaultStyle">
                    <h3 class="block-title">商品管理</h3>
                    <form action='/goods' method='post' name='myform'>
                        <input type='hidden' name='_token' value='{{ csrf_token() }}'>
                         <input type='hidden' name='_method' value='DELETE'>
                    </form>
                    <form action='/admin/goods' method='get'>
                        <div class='media-body'>
                            姓名：<input type='text' class='form-control m-b-5' name='sname'>
                        </div>
                        <input type='submit' class='btn' value='搜索'>
                    </form>
                    <table class="table tile">
                        <thead>
                            <tr>
                                <th>编号</th>
                                <th>商品名称</th>
                                <th>商品类别</th>
                                <th>商品价格</th>
                                <th>展示图</th>
                                <th>大图</th>
                                <th>库存</th>
                                <th>推荐</th>
                                <th>商品介绍</th>
                                <th>商品状态</th>
                                <th>回收站</th>
                                <th>热度</th>
                                <th>折扣</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach ($list as $v)
                                <tr>
                                    <td>{{ $v->id }}</td>
                                    <td>{{ $v->sname }}</td>
                                    <td>{{ $v->type == 1?"手机":"电脑" }}</td>
                                    <td>{{ $v->price }}</td>
                                    <td>{{ $v->pic }}</td>
                                    <td>{{ $v->bigpic }}</td>
                                    <td>{{ $v->stock }}</td>
                                    <td>{{ $v->hotid == 0?"推荐":"不推荐" }}</td>
                                    <td>{{ $v->body }}</td>
                                    <td>{{ $v->under == 0?"下架":"上架" }}</td>
                                    <td>{{ $v->bin == 0?"正常":"删除"}}</td>
                                    <td>{{ $v->Hlevel }}</td>
                                    <td>{{ $v->discount }}</td>
                                    <td>
                                        <!-- <a href="{{ url('admin/goos') }}">删除</a> -->
                                        <a href="javascript:doDel({{ $v->id }})" class='btn'>删除</a>
                                        <a href="/admin/goods/{{ $v->id }}/edit" class='btn'>修改</a> 
                                    </td>
                                <tr>
                            @endforeach
                        </tbody>
                    </table>
                     {{ $list->appends($where)->links() }}
                    <script>
                        function doDel(id)
                        {
                            if(confirm("你确定删除吗?")){
                                var form = document.myform;
                                form.action = "/admin/goods/"+id;
                                form.submit();
                            }
                        }
                    </script>
 
                </div>
@stop